package com.road.yishi.dao.utils;

import java.util.HashMap;
import java.util.Map;

import org.aeonbits.owner.ConfigFactory;

public class DefConfigFactory {

	public static AppConfig createUATConfig() {
		return createConfig(EnvEnum.UAT.getEnv());
	}

	public static AppConfig createDEVConfig() {
		return createConfig(EnvEnum.DEV.getEnv());
	}

	public static AppConfig createPRODConfig() {
		return createConfig(EnvEnum.PROD.getEnv());
	}

	public static AppConfig createConfig(String env) {
		Map<String, String> myVars = new HashMap<String, String>();
		myVars.put("env", env);
		System.setProperty("env", env);
		return ConfigFactory.create(AppConfig.class, myVars);
	}

}
